<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <script src="//cdn.bootcss.com/angular.js/1.5.6/angular.min.js"></script>
    <script src="https://cdn.bootcss.com/sockjs-client/1.1.4/sockjs.min.js"></script>
    <script src="https://cdn.bootcss.com/stomp.js/2.3.3/stomp.min.js"></script>
    <script type="text/javascript">
        /*<![CDATA[*/
        var app = angular.module('app', []);
        app.controller('MainController', function ($rootScope, $scope, $http) {

            $scope.question = '';
            $scope.answer = '';

            $scope.sendQuestion = function () {
                $http({
                    url: "/auth/robot/answer?question=" + $scope.question,
                    method: 'GET'
                }).success(function (data) {
                    console.log(data);
                    $scope.answer = data;
                })
            }

        });
        /*]]>*/
    </script>
</head>
<body ng-app="app" ng-controller="MainController">
<input type="text" ng-model="question">
<button ng-click="sendQuestion()">提交</button>
<div ng-if="answer.message==='text'">{{answer.data}}</div>
<div ng-if="answer.message==='joke'">
    title:{{answer.data.title}}<br>
    content:{{answer.data.content}}
</div>
<div ng-if="answer.message==='guanyin'">
    haohua:{{answer.data.haohua}}<br>
    jieqian:{{answer.data.jieqian}}<br>
    number1:{{answer.data.number1}}<br>
    number2:{{answer.data.number2}}<br>
    qianyu:{{answer.data.qianyu}}<br>
    shiyi:{{answer.data.shiyi}}<br>
    type:{{answer.data.type}}<br>
</div>
<div ng-if="answer.message==='yuelao'">
    haohua:{{answer.data.haohua}}<br>
    jieqian:{{answer.data.jieqian}}<br>
    number1:{{answer.data.number1}}<br>
    number2:{{answer.data.number2}}<br>
    shiyi:{{answer.data.shiyi}}<br>
    type:{{answer.data.type}}<br>
</div>
<div ng-if="answer.message==='caishenye'">
    hunyin:{{answer.data.hunyin}}<br>
    jiaoyi:{{answer.data.jiaoyi}}<br>
    jieguo:{{answer.data.jieguo}}<br>
    jieqian:{{answer.data.jieqian}}<br>
    jieshuo:{{answer.data.jieshuo}}<br>
    qianyu:{{answer.data.qianyu}}<br>
    number1:{{answer.data.number1}}<br>
    number2:{{answer.data.number2}}<br>
    shiyi:{{answer.data.shiyi}}<br>
    type:{{answer.data.type}}<br>
    zhushi:{{answer.data.zhushi}}<br>
</div>
</body>
</html>